#pragma once

#include "effectbase.h"
#include <osg\PositionAttitudeTransform>
#include <osg\Billboard>
#include <osg\Geometry>

namespace VrDataCore
{
	class VRDATACORE_EXPORT TextureBillboardEffect:public EffectBase
	{
	public:
		TextureBillboardEffect();
	protected:
		~TextureBillboardEffect();
		void createBillboardNode();
	public:
		virtual void buildPropertyMap();
		virtual void apply(CoreBase::ActorBase* actor);
		virtual void unApply(CoreBase::ActorBase* actor);
		void setBillboardTexture(QString texture);
		QString getBillboardTexture();
		void setPosition(osg::Vec3 pos);
		osg::Vec3 getPosition();
		void setSize(float size);
		float getSize();
	protected:
		QString												_iconFile;
		osg::ref_ptr<osg::PositionAttitudeTransform>		_billboardTransform;
		osg::ref_ptr<osg::Billboard>						_billboard;
		osg::ref_ptr<osg::Vec3Array>						_array;
		osg::ref_ptr<osg::Geometry>							_geometry;
		osg::Vec3											_position;
		float												_size;
		osg::Vec4											_color;
	};
}